//
//  CMBasicData.m
//  CardManage
//
//  Created by 斌 on 2017/11/7.
//  Copyright © 2017年 mupay. All rights reserved.
//

#import "CMBasicData.h"

@implementation CMBasicData
static NSMutableDictionary *allData;

NSString *kServerHttpBaseUrl = @"http://192.168.5.53/";

+ (void)setData:(id)valueData key:(NSString *)keyString {
    
    if ([keyString isEqualToString:@"clean"]) {
        allData=[[NSMutableDictionary alloc]init];
        return ;
    }
    
    if (!allData) {
        allData=[[NSMutableDictionary alloc]init];
        
    }
    
    if ([allData objectForKey:keyString]) {
        [allData removeObjectForKey:keyString];
    }
    
    [allData setValue:valueData forKey:keyString];
}

+ (id)getData:(NSString *)pathString {
    
    NSArray *tempAr = [pathString componentsSeparatedByString:@"/"];
    
    NSDictionary *tempDict = allData;
    
    for (int i=0;i < tempAr.count;i++) {
        
        tempDict = [tempDict objectForKey:[tempAr objectAtIndex:i]];
        
    }
    
    if (!tempDict) {
        return @"";
    }
    
    return tempDict;
}
YLLoginModel *merInfo;
+ (void)setMerInfo:(YLLoginModel *)info {
    
    merInfo = info;
    
}

+ (YLLoginModel *)getMerInfo {
    
    if (!merInfo) {
        merInfo = [[YLLoginModel alloc] init];
    }
    
    return merInfo;
}
@end
